# 跨平台配置
QT += core network
QT -= gui

TARGET = EncodeTransmit
CONFIG += console
CONFIG -= app_bundle
CONFIG += c++11

TEMPLATE = app

SOURCES += main.cpp \
           UdpReceiver.cpp \
           ImageProcessor.cpp \
           DataSender.cpp

HEADERS += \
           UdpReceiver.h \
           ImageProcessor.h \
           DataSender.h

# 判断操作系统
win32 {
    message("配置Windows环境...")
    FFMPEG_DIR = D:/ffmpeg-sdk
    
    INCLUDEPATH += $$FFMPEG_DIR/include
    
    contains(QMAKE_HOST.arch, x86_64) {
        LIBS += -L$$FFMPEG_DIR/lib/win64
    } else {
        LIBS += -L$$FFMPEG_DIR/lib/win32
    }
}

unix {
    message("配置Linux环境...")
    FFMPEG_DIR = /usr/local/ffmpeg
    
    INCLUDEPATH += $$FFMPEG_DIR/include \
                   /usr/include
    
    LIBS += -L$$FFMPEG_DIR/lib \
            -L/usr/lib/x86_64-linux-gnu
}

# FFmpeg库链接
LIBS += -lavcodec \
        -lavdevice \
        -lavfilter \
        -lavformat \
        -lavutil \
        -lpostproc \
        -lswscale \
        -lswresample

# 调试信息
message("FFmpeg头文件路径: " $$INCLUDEPATH)
message("链接库路径: " $$LIBS)
